const { defineConfig } = require('@vue/cli-service')
const distName = process.env.VUE_APP_NAME
const nowDates = nowDateNumberMinute()
module.exports = defineConfig({
  outputDir: `./dist/Ancient-${distName}${nowDates}`,//打包到dist路径下面
  assetsDir: './static',//静态文件包
  transpileDependencies: true,
  lintOnSave: false
})

function nowDateNumberMinute() {
  const a = new Date().getTime(); //获取到当前时间戳
  const b = new Date(a); //创建一个指定的日期对象
  return nowDate(b)
}
function nowDate(now) {
  const year = now.getFullYear(); //年份
  const month = padNumber(now.getMonth() + 1);
  const day = padNumber(now.getDate());
  const hour = padNumber(now.getHours());
  const minute = padNumber(now.getMinutes());
  const seconds = padNumber(now.getSeconds());
  return `${year}${month}${day}${hour}${minute}`
}
function padNumber(num) {
  return num < 10 ? '0' + num : num;
}